angular.module("app").controller("passport.make.Ctrl", ["$scope", "passport", "$state", "$stateParams", function ($scope,passport,$state,$stateParams) {
    $scope.searchData = {
        cardId: '',
        orderId: ''
    }
    passport.getList({}, {status: 10}, function (data) {
        $scope.passportInfo = data.data.data
    })
    $scope.search = function () {
        passport.getList({}, {status: 10, cardNo: $scope.searchData.cardId || null, num: $scope.searchData.orderId || null}, function (data) {
            $scope.passportInfo = data.data.data
        })
    }
    passport.getDistrict({}, {}, function (data) {
        $scope.districtInfo = data.data
    })
    $scope.districtChange = function () {
        passport.getAddress({}, {area: $scope.districtName}, function (data) {
            $scope.addressInfo = data.data.data
        })
    }
    $scope.allotAddress = function () {
        passport.allotAddress({}, {passportId: Number($stateParams.id), addressId: $scope.addressId}, function (data) {
            alert(data.statusMessage)
            $state.go('home.passport.make')
        })
    }
}])